#!/bin/bash
node="$1"
src_mgmt="/home/hzz/git_worktree/bugfix_quota_local/mgmtd/build/orcafs-mgmtd"
dest_mgmt="/opt/orcafs/sbin/orcafs-mgmtd"

function update_mgmt()
{
    echo -------------"${node}"-----------
    sshpass -p 'p@ssword' ssh root@192.168."${node}" 'systemctl stop orcafs-mgmtd'
    sshpass -p 'p@ssword' scp ${src_mgmt} root@192.168."${node}":${dest_mgmt}
    sshpass -p 'p@ssword' ssh root@192.168."${node}" 'systemctl start orcafs-mgmtd'
}

update_mgmt
